/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.lostreseditores.logica;

import com.lostreseditores.modelo.Examen;
import com.lostreseditores.persistencia.ExamenFacadeLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author DILOVE
 */
@Stateless
public class ExamenLogica implements ExamenLogicaLocal {
    @EJB
    private ExamenFacadeLocal examenDAO;
    
    @Override
    public void registrar(Examen examen) throws Exception {
        examenDAO.create(examen);
    }

    @Override
    public void modificar(Examen examen) throws Exception {
        examenDAO.edit(examen);
    }

    @Override
    public void eliminar(Examen examen) throws Exception {
        examenDAO.remove(examen);
    }

    @Override
    public Examen consultarPorId(Integer idExamen) throws Exception {
        return examenDAO.find((Object)idExamen);
    }

    @Override
    public List<Examen> consultar() throws Exception {
        return examenDAO.findAll();
    }

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
}
